package com.jfm.jfmm.collector.driver;

import com.jfm.jfmm.collector.entity.collect.CollectParam;
import com.jfm.jfmm.collector.entity.collect.Param;
import com.jfm.jfmm.collector.entity.collect.Result;
import com.jfm.jfmm.collector.entity.collect.param.ICMPParam;
import com.jfm.jfmm.collector.entity.collect.result.ICMPResult;
import com.jfm.jfmm.collector.entity.device.Device;
import com.jfm.jfmm.collector.entity.template.CollectTemplate;
import com.jfm.jfmm.collector.enums.CollectorProtocol;

import java.util.List;

/**
 * @author DYang
 * @since 2024-10-11 22:19
 */
public abstract class ICMPDriver implements ACollectorDriver<ICMPParam, ICMPResult>{

    @Override
    public boolean isAvailable(Param param) {
        return true;
    }

    @Override
    public CollectorProtocol supportProtocol() {
        return CollectorProtocol.ICMP;
    }

    @Override
    public ICMPParam transformParam(Param reqParam) {
        if (reqParam instanceof ICMPParam) {
            return (ICMPParam) reqParam;
        }
        return null;
    }

    @Override
    public ICMPResult transformResult(Result result) {
        if (result instanceof ICMPResult) {
            return (ICMPResult) result;
        }
        return null;
    }

    @Override
    public List<CollectParam> buildCollectParam(Device device, CollectTemplate template) {
        return null;
    }
}
